<?xml version="1.0" encoding="Windows-1250"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/REC-html40">
  <xsl:output method="html" encoding="windows-1250"/>

  <xsl:template match="DPOutput">
      <xsl:if test="DPParam='OK'">
        <p>
          <font color="ff0000">Password reinitialization completed.</font>
        </p>
      </xsl:if>
      <xsl:if test="DPParam='BADOLDPWD'">
        <p>
          <font color="ff0000">Password reinitialization completed.</font>
          <!--<font color="ff0000">Old password was wrong.</font>-->
        </p>
      </xsl:if>
      <xsl:if test="DPParam='BADLGN'">
        <p>
          <font color="ff0000">Provided login name does not exist.</font>
        </p>
      </xsl:if>
      <xsl:if test="DPParam='CANNOTUPDATE'">
        <p>
          <font color="ff0000">Cannot update password. Please, contact the system admninistrator.</font>
        </p>
      </xsl:if>
    <p>

      <form name="login" method="post" action="?" onsubmit="return check(document.login)">
        <h3>User password reinitialization</h3>
        <input type="hidden" name="dp" value="pwd_upd"/>
        <blockquote>
          <table cellpadding="2" border="0">
            <tr>
              <td class="label">Login:</td>
              <td>
               <input type="text" name="lgn" size="15" maxlength="15"/>
              </td>
            </tr>
            <tr>
              <td class="label">New password:</td>
              <td>
                <input type="password" name="pwd_new" size="15" maxlength="15"/>
              </td>
            </tr>
            <tr>
              <td class="label">Repeat:</td>
              <td>
                <input type="password" name="pwd_pom" size="15" maxlength="15"/>
              </td>
            </tr>
            <tr>
              <td align="right" colspan="2">
                <input type="submit" value="Confirm"/>
              </td>
            </tr>
          </table>
        </blockquote>
      </form>

      <script language="JavaScript" type="text/javascript"><xsl:comment>document.login.lgn.focus();
           function check(f)
           {
             if(!valText(f.lgn,"Login")) return false;
             if(!valText(f.pwd_new,"New password")) return false;
             if(!valText(f.pwd_pom,"Repeated password")) return false;
             if(f.pwd_new.value != f.pwd_pom.value)
             {
               alert("Badly repeated password");
               f.pwd_pom.value="";
               f.pwd_new.value="";
               f.pwd_new.focus();
               return false;
             }
             return true;
        }

        function valText(elem,nazev) {
        	var s=elem.value;
        	if (s.length==0 || countT(s, ' ')==s.length) {
        		alert("Must enter: "+nazev);
        		elem.focus();
        		elem.select();
        		return false;			
        	} else 
        		return true;		 
        }
          
        function countT(s, charSet) 
        {
          var counter=0;
          for(i=0; i&lt;s.length; i++) 
          {
            if(charSet.indexOf(s.charAt(i)) > -1)
            counter++;
          }
          return counter;

        }//</xsl:comment></script>

    </p>
  </xsl:template>

  <xsl:template name="title">User Change</xsl:template>


</xsl:stylesheet>